/*
 * ParseResult.scala
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package org.marverse.language

sealed trait ParseResult[+T, +R] { }

sealed trait AcceptingResult[+T, +R] extends ParseResult[T, R] {
  val remaining: Stream[T]
}

final case class Success[+T, +R](val remaining: Stream[T], val result: R)
extends AcceptingResult[T, R] { }

final case class SuccessOmit[+T](val remaining: Stream[T])
extends AcceptingResult[T, Nothing] { }

final case object Failure
extends ParseResult[Nothing, Nothing] { }

final case class FailureAccept[+T](val remaining: Stream[T])
extends AcceptingResult[T, Nothing] { }

